package com.tjw.ec.upms.api.feign;

import com.tjw.ec.common.core.constant.ServiceNameConstants;
import com.tjw.ec.common.core.util.Response;
import com.tjw.ec.common.web.config.FeignOauth2RequestInterceptor;
import com.tjw.ec.upms.api.dto.RoleVO;
import com.tjw.ec.upms.api.feign.factory.RemoteRoleServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 远程调用接口 : 角色表,基本权限的集合。无上级与下级之分;
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-08-02 11:58:44
 */
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.UMPS_SERVICE, configuration = FeignOauth2RequestInterceptor.class,fallbackFactory = RemoteRoleServiceFallbackFactory.class)
public interface RemoteRoleService {

    /**
     * @Title: 根据用户id查询用户角色
     * @Param: [userId] 用户id
     * @return: com.tjw.ec.common.core.util.Response<java.util.List<com.tjw.ec.upms.api.dto.RoleVO>>
     * @Author: 田俊文
     * @Date: 2019/8/2 14:12
     * @Throws:
     */
    @GetMapping("role/getRoleByUserId/{userId}")
    Response<List<RoleVO>> getRoleByUserId(@PathVariable("userId")String userId);
}

